<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="index.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Listar Orgãos</title>
</head>
<body>

<f:view>
		<h:form>
			<div id="topo">
				<div id="logo">
					<img alt="img1" src="img/logo.png" width="250">
				</div>

				<div id="menssagem">
					<p id="texto3">
						<b>Aqui a prestação de contas do seu <br> Município com
							maior Visibilidade.
						</b>
					</p>
				</div>

				<div id="logotcm">
					<a href="http://www.tcm.ce.gov.br/site/index.php"> <img
						alt="img1" src="img/logotcm.png" width="70">
					</a>
				</div>

			</div>

				
			<div id="backMenu">

				<div id="menu">
					<a href="http://localhost:8080/TrabalhoII-Persistencia/faces/index.jsp" class="links">Home</a>
					<a href="http://localhost:8080/TrabalhoII-Persistencia/faces/agentes.jsp" class="links">Agentes</a>
					<a href="http://localhost:8080/TrabalhoII-Persistencia/faces/despesas.jsp" class="links">Despesas</a>
					<a href="http://localhost:8080/TrabalhoII-Persistencia/faces/licitacoes.jsp" class="links">Licitações</a>

				</div>

			</div>

			<div id="descricaoSistema">

					<div id="textLic">
						<p id="textoLicitacao">Listar Despesas.</p>
					</div>
		
					<div id="itens1">
					<h:panelGrid columns="4">
						<h:panelGroup>
							<h:outputText value="Selecione Município: " styleClass="mfonte"/>
							
							<h:selectOneMenu value="#{ProjetoBean.municipio.codigo}" styleClass="mfonte">
								<f:selectItems value="#{ProjetoBean.municipioBean.municipiosSel}" id="mfonte2" />
							</h:selectOneMenu>
							
						</h:panelGroup>

						<h:panelGroup>
							<h:outputText value="Informe o Ano: " styleClass="mfonte" />
							<h:inputText value="#{ProjetoBean.ano}" required="true" />
						</h:panelGroup>

						<h:panelGroup>
						<h:commandButton action="#{ProjetoBean.ListarOrgaos}"
								value="Listar" />
						</h:panelGroup>
					</h:panelGrid>
					</div>
					
					<div id = "divTabela" style="overflow: -moz-srollbars-vertical; height: 150px; margin: auto;">
						
						<h:dataTable value="#{ProjetoBean.orgaoBean.orgaos}"
								var="orgao" headerClass="mfonte2" columnClasses="mfonte8"
								cellspacing="2" >

								<h:column>
									<f:facet name="header">
										<h:outputText value="Nome do Orgão" />
									</f:facet>
									<h:outputText value="#{orgao.nome_orgao}" />
								</h:column>
								
								<h:column>
									<h:outputText value="#{orgao.codigo_orgao}" />
									<f:facet name="header">
										<h:outputText value="Cod Orgao" />
									</f:facet>
								</h:column>

								<h:column>
									<h:outputText value="#{orgao.exercicio_orcamento}" />
									<f:facet name="header">
										<h:outputText value="Exer Orcam" />
									</f:facet>
								</h:column>	
								
								<h:column>
									<h:commandLink value="Consultar"  action="#{ProjetoBean.ConsultarGastosComOrgao}">
										<f:setPropertyActionListener value="#{orgao}" target="#{ProjetoBean.orgao}"/>
									</h:commandLink>
									<f:facet name="header">
										<h:outputText value="Consultar" />
									</f:facet>
								</h:column>				
						</h:dataTable>
					</div>
				</div>		
		


			<div id="rodape">
				<p id="texto2">
					copyright<br> Ômega Corporation:<br> Alessandro, Felipe
					de Freitas<br> Paulo Ivo, Pedro José Rodrigues de Sousa,
					Ronaldo Dantas.
				</p>
				<iframe
					src="https://www.facebook.com/plugins/like.php?href=http://localhost:8080/TrabalhoII-Persistencia/faces/index.jsp"
					scrolling="no" frameborder="0"
					style="border: none; width: 450px; height: 80px"></iframe>
			</div>
		</h:form>
	</f:view>
</body>
</html>
